import React, { Component } from 'react'

class View extends Component {
  constructor(props) {
    super(props)
    this.state = {}
  }

  render() {
    let { title, buttons, onClick } = this.props
    console.log(this.props.onClick)
    return (
      <div>
        <div className="head">
          <h2>{title}</h2>
        </div>
        <div className="body">Modal body text goes here.</div>
        <div className="foot">
          {buttons.map((res, i) => {
            return (
              <button key={i} onClick={(e) => onClick(e)}>
                {res}
              </button>
            )
          })}
        </div>
      </div>
    )
  }
}
export default View
